package acwing.哈希;

import java.util.Scanner;

/**
 * 单词分析
 *
 * @author yang
 * @date 2021/12/15
 */
public class 单词分析 {

    static char[] c = new char[1010];
    static int[]n = new int[30];
    static int res;
    static char ans;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        c = s.toCharArray();
        for (int i = 0; i < c.length; i++) {
            n[c[i]]++;
        }
        for (char i = 'a'; i < 'z'; i++) {
            if (n[i] > res) {
                res = n[i];
                ans = i;
            }
        }
        System.out.println(ans);
        System.out.println(res);
    }
}
